<layout name="layout" />
<if condition="$pm eq '1'">
   	<if condition="$refType eq '采购入库'">
	<script src="{$uri}Public/Scripts/PSI/Bill/PWViewForm.js?dt={$dtFlag}" type="text/javascript"></script>
   	</if>
   	<if condition="$refType eq '采购退货出库'">
	<script src="{$uri}Public/Scripts/PSI/Bill/PRViewForm.js?dt={$dtFlag}" type="text/javascript"></script>
   	</if>
   	<if condition="$refType eq '销售出库'">
	<script src="{$uri}Public/Scripts/PSI/Bill/WSViewForm.js?dt={$dtFlag}" type="text/javascript"></script>
   	</if>
   	<if condition="$refType eq '销售退货入库'">
	<script src="{$uri}Public/Scripts/PSI/Bill/SRViewForm.js?dt={$dtFlag}" type="text/javascript"></script>
   	</if>
   	<if condition="$refType eq '调拨出库'">
	<script src="{$uri}Public/Scripts/PSI/Bill/ITViewForm.js?dt={$dtFlag}" type="text/javascript"></script>
   	</if>
   	<if condition="$refType eq '调拨入库'">
	<script src="{$uri}Public/Scripts/PSI/Bill/ITViewForm.js?dt={$dtFlag}" type="text/javascript"></script>
   	</if>
   	<if condition="$refType eq '库存盘点-盘亏出库'">
	<script src="{$uri}Public/Scripts/PSI/Bill/ICViewForm.js?dt={$dtFlag}" type="text/javascript"></script>
   	</if>
   	<if condition="$refType eq '库存盘点-盘盈入库'">
	<script src="{$uri}Public/Scripts/PSI/Bill/ICViewForm.js?dt={$dtFlag}" type="text/javascript"></script>
   	</if>
</if>

<script>
<if condition="$pm eq '1'">
    Ext.onReady(function(){
    	<if condition="$refType eq '采购入库'">
    		var form = Ext.create("PSI.Bill.PWViewForm", {
    			ref: "{$ref}"
    		});
    		form.show();
    	</if>
    	
    	<if condition="$refType eq '采购退货出库'">
			var form = Ext.create("PSI.Bill.PRViewForm", {
				ref: "{$ref}"
			});
			form.show();
		</if>

    	<if condition="$refType eq '销售出库'">
			var form = Ext.create("PSI.Bill.WSViewForm", {
				ref: "{$ref}"
			});
			form.show();
    	</if>
    	
    	<if condition="$refType eq '销售退货入库'">
			var form = Ext.create("PSI.Bill.SRViewForm", {
				ref: "{$ref}"
			});
			form.show();
    	</if>

    	<if condition="$refType eq '调拨出库'">
			var form = Ext.create("PSI.Bill.ITViewForm", {
				ref: "{$ref}"
			});
			form.show();
		</if>
		
		<if condition="$refType eq '调拨入库'">
			var form = Ext.create("PSI.Bill.ITViewForm", {
				ref: "{$ref}"
			});
			form.show();
		</if>

		<if condition="$refType eq '库存盘点-盘亏出库'">
			var form = Ext.create("PSI.Bill.ICViewForm", {
				ref: "{$ref}"
			});
			form.show();
		</if>
		
		<if condition="$refType eq '库存盘点-盘盈入库'">
			var form = Ext.create("PSI.Bill.ICViewForm", {
				ref: "{$ref}"
			});
			form.show();
		</if>
    });
</if>
</script>